package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	_, _ = fmt.Scan(&n)

	data := make([]int, n)
	for i := 0; i < n; i++ {
		_, _ = fmt.Scan(&data[i])
	}

	f(data)
}

func f(data []int) {
	newData := make([]int, len(data))
	copy(newData, data)
	sort.Ints(newData)
	mid := len(data) / 2

	left := newData[mid-1]
	right := newData[mid]
	for i := 0; i < len(data); i++ {
		if data[i] >= right {
			fmt.Println(left)
		} else {
			fmt.Println(right)
		}
	}
}
